from typing import Optional
from fastapi import FastAPI
from pydantic import BaseModel, Field, HttpUrl
from typing import List
from pydantic import BaseModel

from enum import Enum


class MediaType(str, Enum):
    AUDIO = "audio"
    VIDEO = "video"


class AudioSeparationItem(BaseModel):
    audio_url: HttpUrl = Field(
        ...,
        description="音频或视频的地址"
    )
    media_type: MediaType = Field(
        MediaType.AUDIO,
        description="提交的媒体类型。可选值: 'audio' (音频) 或 'video' (视频)"
    )


class AudioType(str, Enum):
    VOCAL = "vocal"
    BACKGROUND = "background"
    # 其他可能的音频类型


class SeparatedAudio(BaseModel):
    type: AudioType
    url: HttpUrl


class AudioSeparationResult(BaseModel):
    separated_audios: List[SeparatedAudio]
    original_audio_url: HttpUrl
    status: str
